package factory.simplefactory2;

import java.util.Scanner;

public class Client {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        HumanFactory humanFactory=HumanFactory.getHumanFactory();
        Human human;
        System.out.println("欢迎来到造人环节");
        while (true){
            System.out.println("--------------------------------------------");
            System.out.println("请输入要造什么人(男人,女人,机器人)");
            String str=in.next();
            human =humanFactory.getHuman(str);
            if (human == null) {
                System.out.println("请重新输入");
            }else {
                human.say();
            }
            humanFactory.setHuman(null);
            System.out.println("--------------------------------------------");

        }
    }
}
